#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
int firstUniqChar(char* s)
{
    int count[26];
    memset(count, 0, 26*sizeof(int));
    int len = (int)strlen(s);
    for (int i = 0; i < len; i++)
    {
        count[s[i] - 'a']++;
    }
    for (int i = 0; i < len; i++)
    {
        if (count[s[i] - 'a'] == 1)
        {
            return i;
        }
    }
    return -1;
}
int main()
{
    char s[] = "leetcode";
    printf("%d\n", firstUniqChar(s));
    return 0;
}